 using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using DateTimeChecker;
namespace UnitTestProject1
{
    [TestClass]
//comment
//add more comment
// Tan handsome 
// Giang
    public class CheckDayInMonth
    {
        [TestMethod]
        public void UTCID01()
        {
            Form1 target = new Form1();
            byte month = 1;
            short year = 2000;
            byte expected = 31;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }
/*
        [TestMethod]
        public void UTCID02()
        {
            Form1 target = new Form1();
            byte month = 1;
            byte day = 1;
            short year = 2000;
            bool expected = true;
            bool actual;
            actual = target.IsValidDate(day, month, year);
            Assert.AreEqual(expected, actual);

        }*/

        [TestMethod]
        public void UTCID02()
        {
            Form1 target = new Form1();
            byte month = 2;
            short year = 2015;
            byte expected = 28;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void UTCID03()
        {
            Form1 target = new Form1();
            byte month = 2;
            short year = 2000;
            byte expected = 29;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void UTCID04()
        {
            Form1 target = new Form1();
            byte month = 3;
            short year = 2015;
            byte expected = 31;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void UTCID05()
        {
            Form1 target = new Form1();
            byte month = 4;
            short year = 2015;
            byte expected = 30;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void UTCID06()
        {
            Form1 target = new Form1();
            byte month = 5;
            short year = 2015;
            byte expected = 31;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void UTCID07()
        {
            Form1 target = new Form1();
            byte month = 6;
            short year = 2015;
            byte expected = 30;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void UTCID08()
        {
            Form1 target = new Form1();
            byte month = 7;
            short year = 2015;
            byte expected = 31;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void UTCID09()
        {
            Form1 target = new Form1();
            byte month = 8;
            short year = 2015;
            byte expected = 31;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void UTCID10()
        {
            Form1 target = new Form1();
            byte month = 9;
            short year = 2015;
            byte expected = 30;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void UTCID11()
        {
            Form1 target = new Form1();
            byte month = 10;
            short year = 2015;
            byte expected = 31;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void UTCID12()
        {
            Form1 target = new Form1();
            byte month = 11;
            short year = 2015;
            byte expected = 30;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void UTCID13()
        {
            Form1 target = new Form1();
            byte month = 12;
            short year = 2015;
            byte expected = 31;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void UTCID14()
        {
            Form1 target = new Form1();
            byte month = 13;
            short year = 2015;
            byte expected = 0;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [ExpectedException(typeof(System.FormatException))]
        public void UTCID15()
        {
           
                Form1 target = new Form1();
                byte month = byte.Parse("a");
                short year = 2015;
                byte expected = 0;
                byte actual;
                actual = target.DaysInMonth(month, year);
                Assert.AreEqual(expected, actual);
            
        }

        [TestMethod]
        [ExpectedException(typeof(System.OverflowException))]
        public void UTCID16()
        {
            Form1 target = new Form1();
            byte month = byte.Parse("-1");
            short year = 2015;
            byte expected = 0;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
//        [ExpectedException(typeof(System.OverflowException))]
        public void UTCID17()
        {
            Form1 target = new Form1();
            byte month = 12;
            short year = 999;
            byte expected = 31;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
//        [ExpectedException(typeof(System.OverflowException))]
        public void UTCID18()
        {
            Form1 target = new Form1();
            byte month = 9;
            short year = 3001;
            byte expected = 30;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [ExpectedException(typeof(System.FormatException))]
        public void UTCID19()
        {
            Form1 target = new Form1();
            byte month = 2;
            short year = byte.Parse("a");
            byte expected = 0;
            byte actual;
            actual = target.DaysInMonth(month, year);
            Assert.AreEqual(expected, actual);
        }
    }
}
